import React, { PureComponent } from "react";
import "./index.scss";
import ContextApp from "@Pages/context";
import {formatDate_ZH} from '@Utils'



export default class index extends PureComponent {
  constructor(props) {
    super(props);
    this.state = {
      rules: [
        {
          subTitle: "奖品发放：",
          content: [
            `1.按摩卡券、现金红包及摩币奖品，将自动发放到您的账号，可前往【个人中心】-【我的钱包】内查看；`,
            `2.虚拟卡券奖品，将实时发放卡密或兑换码，请在有效期内使用，逾期未使用视为放弃奖品，不再补偿；`,
            "3.实物奖品将在活动结束后2周内寄出，请及时填写收件信息，地址填写后不可更改，奖品寄出后概不更换。",
          ],
        },
        {
          subTitle: "温馨提示：",
          content: [
            "1.活动期间如有任何刷奖、违规等行为，将取消参与及获奖资格；",
            "2.活动期间产生异常情况，云享云有权取消、暂停本活动。",
          ],
        },
      ],
    };
  }

  
  render() {
    // const { timeSection, times, surplusType } =  this.context.ruleParam;
    return (
      <div className="Rule_Box">
        {/* 标题 */}
        <div className="rule_title">
          <div className="rule_icon"></div>
          <span>活动规则</span>
          <div className="rule_icon"></div>
        </div>
        {/* 规则内容 */}
        <div>
          <div className="rule_list">
            <p className="rule_subTitle">活动时间：</p>
            <div className="rule_content">
              {/* {timeSection && formatDate_ZH(timeSection[0])}-
              {timeSection && formatDate_ZH(timeSection[1])} */}
            </div>
          </div>

          <div className="rule_list">
            <p className="rule_subTitle">活动玩法：</p>
            <div className="rule_content">
              {/* 活动期间{surplusType == 0 && `每人每天享不限`}
              {surplusType == 1 && `每人每天享${times}`}
              {surplusType == 2 && `每人享${times}`} */}
              次免费抽奖机会，按摩下单进入倒计时页面即可参与抽奖。
            </div>
          </div>
          {this.state.rules.map((rule, i) => {
            return (
              <div className="rule_list" key={i}>
                <p className="rule_subTitle">{rule.subTitle}</p>
                <div className="rule_content">
                  {rule.content.map((v, index) => {
                    return <p key={index}>{v}</p>;
                  })}
                </div>
              </div>
            );
          })}
        </div>
      </div>
    );
  }
}
index.contextType = ContextApp;
